package com.liang.maogouyuyin.local.dao

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.Query
import androidx.room.Update
import com.liang.maogouyuyin.bean.PetBean

@Dao
interface PetDao {
    @Insert
    suspend fun save(bean: PetBean)

    @Delete
    suspend fun delete(bean: PetBean)

    @Update
    suspend fun update(bean: PetBean)

    @Query("select * from pet")
    suspend fun loadALl(): List<PetBean>

    @Query("select * from pet where name = :name")
    suspend fun loadByName(name: String): PetBean
}